home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 2010 April / PCWorld0410.iso / hity wydania / Bank smakow / BankSmakow.air / BankSmakow.swf / scripts / com / makingwaves / util / CustomTreeDataDescriptor.as next >
Text File  |  2009-12-16  |  1KB  |  55 lines

  1. package com.makingwaves.util
  2. {
  3.    import com.makingwaves.vo.ProductCategory;
  4.    import mx.collections.ICollectionView;
  5.    import mx.controls.treeClasses.ITreeDataDescriptor;
  6.    
  7.    public class CustomTreeDataDescriptor implements ITreeDataDescriptor
  8.    {
  9.        
  10.       
  11.       public function CustomTreeDataDescriptor()
  12.       {
  13.          super();
  14.       }
  15.       
  16.       public function getData(param1:Object, param2:Object = null) : Object
  17.       {
  18.          return param1;
  19.       }
  20.       
  21.       public function removeChildAt(param1:Object, param2:Object, param3:int, param4:Object = null) : Boolean
  22.       {
  23.          return false;
  24.       }
  25.       
  26.       public function hasChildren(param1:Object, param2:Object = null) : Boolean
  27.       {
  28.          return isBranch(param1,param2);
  29.       }
  30.       
  31.       public function isBranch(param1:Object, param2:Object = null) : Boolean
  32.       {
  33.          if(param1 != null && param1 is ProductCategory)
  34.          {
  35.             return true;
  36.          }
  37.          return false;
  38.       }
  39.       
  40.       public function getChildren(param1:Object, param2:Object = null) : ICollectionView
  41.       {
  42.          if(param1 is ProductCategory)
  43.          {
  44.             return param1.products;
  45.          }
  46.          return null;
  47.       }
  48.       
  49.       public function addChildAt(param1:Object, param2:Object, param3:int, param4:Object = null) : Boolean
  50.       {
  51.          return false;
  52.       }
  53.    }
  54. }
  55.